/**
 * Copyright 2009 Takahiko Ito
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.unigram.oluolu.rqe;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 *
 */
public class RelatedQueryExtractionMapper extends
        Mapper<Text, Text, Text, Text> {

    /**
     * Map method for mapreduce.
     *
     * @param targetQuery  query string
     * @param candidate query string which maybe related to targetQuery
     * @param context context
     * @throws IOException -
     * @throws InterruptedException -
     */
    @Override
    protected final void map(final Text targetQuery,
            final Text candidate, final Context context)
            throws IOException, InterruptedException {
        context.write(targetQuery, candidate); // output Key:targetQuery,
                                               // value:candidateQuery

    }
}
